    <div id="toolbar-box">
      <div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m">
        <div id="toolbar" class="toolbar">
            <table class="toolbar"><tbody><tr>
                    <td id="toolbar-save" class="button"><a class="toolbar" onClick="javascript: submitbutton('save'); return false;" href="javascript:void(0);"> <span title="Save" class="icon-32-save"> </span> Save </a> </td>
                    <td id="toolbar-cancel" class="button"><a class="toolbar" onClick="javascript: submitbutton('cancel'); return false;" href="javascript:void(0);"> <span title="Cancel" class="icon-32-cancel"> </span> Cancel </a> </td>
            </tr></tbody></table>
        </div>
        <div class="header icon-48-user">Thêm Game</div>
        <div class="clr"></div>
      </div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
    </div>
    <div class="clr"></div>
<div id="submenu-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
    <ul id="submenu">
      <li> <a href="<?php echo $this->Html->url(array('controller'=>'game_categories', 'action' => 'index')); ?>">Danh mục</a> </li>
      <li> <a href="<?php echo $this->Html->url(array('controller'=>'game_groups', 'action' => 'index')); ?>">Nhóm</a> </li>
      <li> <a class="active" href="<?php echo $this->Html->url(array('controller'=>'games', 'action' => 'index')); ?>">Games</a> </li>
    </ul>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
    <div id="element-box">
      <div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m">
<script language="javascript" type="text/javascript">
        $(document).ready(function(){
             check_content_type();
            $('#GameContentType').change(function(){
                check_content_type();
            });
        });
        function check_content_type(){
                if( $('#GameContentType').val() == 'html'){
                    $('#content_upload').fadeOut(400, function(){
                        $('#content_htmlcode').fadeIn(700);
                    });
                }else{
                    $('#content_htmlcode').fadeOut(400, function(){
                        $('#content_upload').fadeIn(700);
                    });
                }
        }
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
                if($('#GameTitle').val() == ''){
                    h3l_show_alert($('#GameTitle'), 'Vui lòng nhập title');
                    $('#GameTitle').focus();
                    return;
                }
                if($('#GameCatId').val() == ''){
                    h3l_show_alert($('#GameCatId'), 'Vui lòng chọn 1 danh mục');
                    $('#GameCatId').focus();
                    return;
                }
                submitform( pressbutton );
	}
</script>
    <?php echo $this->Form->create('Game', array('type'=>'file', 'style'=> 'clear: both;', 'name'=>'adminForm', 'id'=>'adminForm')); ?>
      <div class="col">
        <fieldset class="adminform">
        <legend>Thông tin game</legend>
        <table cellspacing="1" class="admintable">
          <tbody>
            <tr>
              <td width="200" class="key"><label for="title">tên game </label>
              </td>
              <td>
                    <?php echo $this->Form->input('title', array('class'=>'inputbox', 'size'=> 70, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="play_times">Số lần chơi</label>
              </td>
              <td>
                    <?php echo $this->Form->input('play_times', array('class'=>'inputbox', 'size'=> 15, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="like_times">Số người thích</label>
              </td>
              <td>
                    <?php echo $this->Form->input('like_times', array('class'=>'inputbox', 'size'=> 15, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="published"> Published </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('published', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '1')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_icon">Hot icon </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('hot_icon', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="show_fullscreen">Show full screen </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('show_fullscreen', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '1')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="popular">Game phổ biến nhất</label>
              </td>
              <td>
                    <?php echo $this->Form->radio('popular', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game">Game hay nhất</label>
              </td>
              <td>
                    <?php echo $this->Form->radio('hot_game', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game_ordering">thứ tự xuất hiện của  game hay nhất</label>
              </td>
              <td>
                    <?php echo $this->Form->input('hot_game_ordering', array('class'=>'inputbox', 'size'=> 5, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game_daily">Game hay nhất trong ngày</label>
              </td>
              <td>
                    <?php echo $this->Form->radio('hot_game_daily', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game_daily_ordering">thứ tự xuất hiện của  game hay nhất trong ngày</label>
              </td>
              <td>
                    <?php echo $this->Form->input('hot_game_daily_ordering', array('class'=>'inputbox', 'size'=> 5, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game_incat">Game hay nhất trong danh mục</label>
              </td>
              <td>
                    <?php echo $this->Form->radio('hot_game_incat', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="hot_game_incat_ordering">thứ tự xuất hiện của  game hay nhất trong danh mục</label>
              </td>
              <td>
                    <?php echo $this->Form->input('hot_game_incat_ordering', array('class'=>'inputbox', 'size'=> 5, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="popular_incat">Game nhiều người chơi nhất trong danh mục</label>
              </td>
              <td>
                    <?php echo $this->Form->radio('popular_incat', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '0')); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="popular_incat_ordering">thứ tự xuất hiện của  game nhiều người chơi nhất trong danh mục</label>
              </td>
              <td>
                    <?php echo $this->Form->input('popular_incat_ordering', array('class'=>'inputbox', 'size'=> 5, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="cat_id">thể loại</label>
              </td>
              <td>
                    <?php echo $this->Form->select('cat_id', $cat_data, array('empty'=> false,'secure'=>true)); ?>
              </td>
            </tr>
            <tr>
              <td width="200" class="key"><label for="group_id">Nhóm</label>
              </td>
              <td>
                    <?php echo $this->Form->select('group_id', $group_data, array('empty'=> false,'secure'=>true)); ?>
              </td>
            </tr>
           <tr>
              <td width="200" class="key"><label for="tags">Tags (phân cách nhau bằng dấu phảy (,) ): </label>
              </td>
              <td>
                    <?php echo $this->Form->input('tags', array('class'=>'inputbox', 'cols'=> 60, 'label'=> false, 'type'=>'textarea')); ?>
              </td>

            </tr>
            <tr>
              <td width="200" class="key"><label for="content_type">Kiểu dữ liệu nguồn</label>
              </td>
              <td>
                    <?php echo $this->Form->select('content_type',$contenttype_list, array('empty'=> false,'secure'=>true)); ?>
              </td>
            </tr>
            <tr id="content_upload">
              <td width="200" class="key"><label for="filename">upload</label>
              </td>
              <td>
                    <?php echo $this->Form->input('filename', array('type'=>'file', 'class'=>'inputbox', 'size'=> 40, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr id="content_htmlcode" style="display: none;">
              <td width="200" class="key"><label for="html_content">Code</label>
              </td>
              <td>
                    <?php echo $this->Form->input('html_content', array('class'=>'inputbox', 'cols'=> 60, 'label'=> false, 'type'=>'textarea','div'=>false)); ?>
              </td>
            </tr>

            <tr>
              <td width="200" class="key"><label for="thumbnail">Thumbnail </label>
              </td>
              <td>
                    <?php echo $this->Form->input('thumbnail', array('type'=>'file', 'class'=>'inputbox', 'size'=> 40, 'label'=> false,'div'=>false)); ?>
              </td>
            </tr>
            <tr>
              <td class="key"><label for="content">Nội dung & Hướng dẫn chơi game </label>
              </td>
              <td>
                    <?php echo $this->Editor->loadEditor('data[Game][description]'); ?>
              </td>
            </tr>
          </tbody>
        </table>
        </fieldset>
      </div>
      <div class="clr"></div>
      <?php echo $this->Form->input('id', array('type'=>'hidden')); ?>
      <input type="hidden" name="task" value="" />
    </form>
        <div class="clr"></div>
      </div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
    </div>
